package com.kgc.scd.service;

import com.kgc.scd.bean.Seckill;
import com.kgc.scd.bean.SeckillNotifyResult;
import com.kgc.scd.bean.SeckillResult;

import java.util.List;

/**
 * @program: com.kgc.scd.service
 * @author: HarryXzy
 * @create: 2022-06-14 12:07
 * @description:
 **/

public interface SecKillService {

    /**
    * @author: HarryXzy
    * @date: 2022/6/14 12:12
    * @return: java.util.List<com.kgc.scd.bean.Seckill>
    * @description: 获取所有的秒杀活动
    */
    List<SeckillResult> getAllSecKill();

    /**
    * @author: HarryXzy
    * @date: 2022/6/14 13:43
    * @return: boolean
    * @description: 判断该用户是否已经加入通知
    */
    boolean userHaveNotify(String userId, String secKillid);

    /**
    * @author: HarryXzy
    * @date: 2022/6/14 13:52
    * @return: boolean
    * @description: 判断能否进行通知（秒杀活动时间是否已小于11分钟）
    */
    boolean canNotify(String secKillid);

    /**
    * @author: HarryXzy
    * @date: 2022/6/14 14:36
    * @return: void
    * @description: 增加通知
    */
    void addNotify(String userId, String secKillid);


    /**
    * @author: HarryXzy
    * @date: 2022/6/14 16:12
    * @return: boolean
    * @description: 判断秒杀活动是否已经结束
    */
    boolean secKillHaveEnd(String secKillid);


    /**
    * @author: HarryXzy
    * @date: 2022/6/15 10:24
    * @return: java.util.List<com.kgc.scd.bean.NotifySeckill>
    * @description: 获取当前要通知的
    */
    List<SeckillNotifyResult> getNowNeedNotify();


    /***
    * @author: HarryXzy
    * @date: 2022/6/15 15:52
    * @return: void
    * @description: 添加秒杀活动
    */
    void addSecKill(Seckill seckill);

    SeckillResult getSecKillResultById(String seckillId);
}
